#include "static_functions.h"
#include <QString>
#include <QMainWindow>
#include <mainwindow.h>


QString StaticFunctions::spendMSToString(long long spendTimeMS) {
    int spendMinutes = spendTimeMS/1000/60;
    int spendSeconds = spendTimeMS/1000 % 60;
    int spendMSeconds = spendTimeMS % 1000;
    return QString("%1分 %2.%3秒").arg(spendMinutes).arg(spendSeconds, 2, 10, QLatin1Char('0')).arg(spendMSeconds, 3, 10, QLatin1Char('0'));
}



void StaticFunctions::noticeRouteTrainDialogClosed() {
    if (MainWindow::instance != NULL) {
        MainWindow::instance->routeTrainDialogClosed();
    }
}

void StaticFunctions::noticeDisplayRouteTrainResult(void * list, bool isEnd)
{
    RouteTrainDialog::instance->displayRouteTrainResult((QList<RouteTrainDisplayInfo*> *) list, isEnd);
}
